Finale Draft:
//      To alter Pin, change PIN1,PIN2,PIN3 & PIN4 within the Define Four Digits 
//      section, after the #define PINX to the desired value, using the table below.

//      Pin Digit 0 = PORTB & 0X01
//      Pin Digit 1 = PORTB & 0X02
//      Pin Digit 2 = PORTB & 0X04
//      Pin Digit 3 = PORTB & 0X08
//      Pin Digit 4 = PORTB & 0X10
//      Pin Digit 5 = PORTB & 0X20
//      Pin Digit 6 = PORTB & 0X40
//      Pin Digit 7 = PORTB & 0X80
//      Pin Digit 8 = PORTC & 0X01
//      Pin Digit 9 = PORTC & 0X02
//      Pin Digit * = PORTC & 0X04
//      Pin Digit # = PORTC & 0X08

// Define Four Digits for Pin
#define PIN1     (PORTB & 0X01)                                                  // Alter for Pin Digit One
#define PIN2     (PORTB & 0X02)                                                  // Alter for Pin Digit Two
#define PIN3     (PORTC & 0X01)                                                  // Alter for Pin Digit Three
#define PIN4     (PORTC & 0X02)                                                  // Alter for Pin Digit Four

int Pin_Step = 0;                                                                // Variable for Pin Step set to Zero
unsigned int Timer = 0;                                                          // Timer Variable
unsigned int Button_Count = 0;                                                   // Button Count Variable

void main() {                                                                    // Main Program Below
    TRISB = 0XFF;                                                                // Set Port B as Input
    TRISC = 0XFF;                                                                // Set Port C as Input
    TRISD = 0X00;                                                                // Set Port D as Output
    PORTD = 0X01;                                                                // Set Port D Pin Zero On

    while (1) {                                                                  // Pin Program Logic
        // Reset If Wrong
        if (PORTB & 0xFF) {                                                      // Check if PORTB is Pressed
            Button_Count++;                                                      // Increase Button Count
        }

        if (PORTC & 0xFF) {                                                      // Check if PORTC is Pressed
            Button_Count++;                                                      // Increase Button Count
        }

        if (Button_Count > 4) {                                                  // Only Four Buttons Can be Pressed
            Pin_Step = 0;                                                        // Reset Pin Step
            Button_Count = 0;                                                    // Reset Button Count
            Delay_ms(500);                                                       // Delay
        }

        // Pin Digit One
        if (Pin_Step == 0 && PIN1) {                                             // If Pin Digit 1 is Pressed

            Timer = 0;                                                           // Reset Timer
            while (PIN1);                                                        // Pin Digit 1 Released
            Pin_Step = 1;                                                        // Set Pin Step to One
        }

        // Pin Digit Two
        if (Pin_Step == 1) {                                                     // If Pin Digit 1 has been Pressed
            Timer++;                                                             // Increase Timer by One

            if (Timer >= 200) {                                                  // If Pin Digit 2 not Pressed
                Pin_Step = 0;                                                    // Reset Pin Step
            }
            if (PIN2) {                                                          // If Pin Digit 2 is Pressed
                Timer = 0;                                                       // Reset Timer
                while (PIN2);                                                    // Pin Digit 2 Released
                Pin_Step = 2;                                                    // Set Pin Step to Two
            }
        }

        // Pin Digit Three
        if (Pin_Step == 2) {                                                     // If Pin Digit 2 has been Pressed
            Timer++;                                                             // Increase Timer by One

            if (Timer >= 200) {                                                  // If Pin Digit 3 not Pressed
                Pin_Step = 0;                                                    // Reset Pin Step
            }
            if (PIN3) {                                                          // If Pin Digit 3 is Pressed
                Timer = 0;                                                       // Reset Timer
                while (PIN3);                                                    // Pin Digit 3 Released
                Pin_Step = 3;                                                    // Set Pin Step to Three
            }
        }

        // Pin Digit Four
        if (Pin_Step == 3) {                                                     // If Pin Digit 3 has been Pressed
            Timer++;                                                             // Increase Timer by One

            if (Timer >= 200) {                                                  // If Pin Digit 4 not Pressed
                Pin_Step = 0;                                                    // Reset Pin Step
            }
            if (PIN4) {                                                          // If Pin Digit 4 is Pressed
                while (PIN4);                                                    // Pin Digit 4 Released
                PORTD = 0x00;                                                    // Turn Off Red LED
                PORTD = 0x06;                                                    // Turn On Green LED and Relay
                Delay_ms(5000);                                                  // Keep Green LED and Relay On for 5 Seconds
                PORTD = 0x00;                                                    // Turn Off Green LED and Relay
                PORTD = 0x01;                                                    // Turn Red LED On
                Pin_Step = 0;                                                    // Reset Pin Step
                Button_Count = 0;                                                // Reset Button Count
            }
        }

        Delay_ms(10);                                                            // Delay for Debouncing
    }
}